package book;

public class BookLiet {
    private Book[] books = new Book[20];
    private int usedSize;//存储当前书的个数

    public BookLiet() {
        books[0] = new Book("活着","余华", 29, "小说" );
        books[1] = new Book("追风筝的人","卡勒德.胡赛尼", 19, "小说" );
        books[2] = new Book("无声告白","伍绮诗", 19, "小说" );
        this.usedSize = 3;
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }

    public Book getPos(int pos) {
        return books[pos];
    }

    /*
    * @储存一本书，到指定位置
    * @param book
    * @param pos 在这里指的书，是当前最后可以储存书的位置。
    * */
    public void setBooks(Book book, int pos) {
        books[pos] = book;
    }
}
